<script type="text/javascript" src="{URL_WEB_JS}diyarea.js"></script>
<style>
    .modal-dialog{
        width: 1120px;
    }
</style>
<form action="" method="post" class="form-horizontal form form-validate">
    <input type="hidden" name="c" value="site" />
    <input type="hidden" name="a" value="entry" />
    <input type="hidden" name="m" value="{MODULE_NAME}" />
    <input type="hidden" name="p" value="area" />
    <input type="hidden" name="ac" value="hotarea" />
    <input type="hidden" name="do" value="opareaedit" />
    <input type='hidden' name='id' value="{$id}" />
    <input type="hidden" name="token" value="{$_W['token']}" />
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button data-dismiss="modal" class="close" type="button">×</button>
                <h4 class="modal-title">修改地区</h4>
            </div>
            <div class="modal-body">
                <!--级别选择-->
                <div class="form-group">
                    <label class="col-sm-2 control-label">地区等级</label>
                    <div class="col-sm-9">
                        <label class="radio-inline" onclick="$('#tpl-district').hide();$('#tpl-city').hide();$('#tpl-town').hide();">
                            <input type="radio" value="1" name="districtslevel" {if $area['level']==1}checked{/if}>一级
                        </label>
                        <label class="radio-inline" onclick="$('#tpl-district').hide();$('#tpl-city').show();$('#tpl-town').hide();">
                            <input type="radio" value="2" name="districtslevel" {if $area['level']==2 || empty($area['level'])}checked{/if}>二级
                        </label>
                        <label class="radio-inline" onclick="$('#tpl-district').show();$('#tpl-city').show();$('#tpl-town').hide();">
                            <input type="radio" value="3" name="districtslevel" {if $area['level']==3}checked{/if}>三级
                        </label>
                        <label class="radio-inline" onclick="$('#tpl-district').show();$('#tpl-city').show();$('#tpl-town').show();">
                            <input type="radio" value="4" name="districtslevel" {if $area['level']==4}checked{/if}>四级
                        </label>
                    </div>
                </div>
                <!--区域选择-->
                <div class="form-group">
                    <label class="col-sm-2 control-label">运营地区</label>
                    <div class="col-sm-9">
                        <div class="row row-fix js-address-selector selectArea">
                            <div class="col-md-3" id="tpl-province">
                                <select name="districts[province]" data-value="{$districts['province']}" level="1" class="form-control tpl-province changeArea">
                                    {loop $province $item}
                                        <option value="{$item['id']}" {if $item['id'] == $province_id}selected="selected"{/if}>{$item['name']}</option>
                                    {/loop}
                                </select>
                            </div>
                            <div class="col-md-3" {if $area['level'] == 1}style="display: none;"{/if} id="tpl-city">
                                <select name="districts[city]" data-value="{$districts['city']}" level="2"  class="form-control tpl-city changeArea">
                                    {loop $city $item}
                                        <option value="{$item['id']}" {if $item['id'] == $city_id}selected="selected"{/if}>{$item['name']}</option>
                                    {/loop}
                                </select>
                            </div>
                            <div class="col-md-3" {if $area['level'] <= 2}style="display: none;"{/if} id="tpl-district">
                                <select name="districts[district]" data-value="{$districts['district']}" level="3"  class="form-control tpl-district changeArea">
                                    {loop $district $item}
                                        <option value="{$item['id']}" {if $item['id'] == $district_id}selected="selected"{/if}>{$item['name']}</option>
                                    {/loop}
                                </select>
                            </div>
                            <div class="col-md-3" {if $area['level'] <= 3}style="display: none;"{/if} id="tpl-town">
                                <select name="districts[town]" data-value="{$districts['town']}" level="4"  class="form-control tpl-town changeArea">
                                    {loop $town $item}
                                        <option value="{$item['id']}" {if $item['id'] == $town_id}selected="selected"{/if}>{$item['name']}</option>
                                    {/loop}
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
	            <button class="btn btn-primary btn-submit" type="submit">确认</button>
	            <button data-dismiss="modal" class="btn btn-default" type="button">取消</button>
	        </div>
        </div>
    </div>
</form>